package com.zhanjixun.weixin.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.json.XML;

/**
 * 动画表情
 *
 * @author :zhanjixun
 * @date : 2018/11/19 13:56
 */
@Data
public class Sticker {
    private String designerid;
    private String attachedtext;
    private String fromusername;
    private String productid;
    private String cdnurl;

    private Integer height;
    private Integer width;

    private Integer len;

    private String tpauthkey;
    private Integer type;
    private String tousername;
    private Integer s60v5len;
    private Integer s60v3len;
    private Integer androidlen;

    private String tpurl;

    private String aeskey;
    private String thumburl;
    private String externurl;
    private String idbuffer;
    private String encrypturl;

    private String s60v3md5;
    private String s60v5md5;
    private String externmd5;
    private String androidmd5;
    private String md5;

    public static Sticker valueOf(String xml) {
        return JSON.parseObject(XML.toJSONObject(xml).toString())
                .getJSONObject("msg").getJSONObject("emoji")
                .toJavaObject(Sticker.class);
    }
}
